<?php
    //接受前端发送的数据
    $e_name = $_GET["username"];
    $e_pwd = $_GET["password"];
    $e_tel = $_GET["mobile"];

    echo $e_name;
    echo $e_pwd;
    echo $e_tel;
    //连接数据库
    $db = new mysqli("localhost","root","123456","shopping_center");

    //设置添加sql语句
    $sql = "INSERT INTO user (username,password,mobile) VALUES ( '{$e_name}','{$e_pwd}','{$e_tel}' )";

    //执行sql语句
    $flag = $db->query($sql);

    //判断数据库操作是否成功
    if( $flag ){
        echo '{"ok":true}';
    }else{
        echo '{"ok":false}';
    }
?>


